#require './app/models/dimen_dest_vcb.rb'
require 'active_record'

class TestActiveRecord < Test::Unit::TestCase
  def test_xxx
    r = DimenDestVcb.new.find(:all)
    assert(false)
  end
  
  # TODO uninitialized constant DimenTrunkGroupCarrier
  def test_find_trunk_group_carrier
    
    '''
    parameters:
      src_carrier \
  ,   src_ip \
  ,   dest_vcb \
  ,   trunk_group_col_name \
  ,   trunk_group_provider_name \
  ,   identifying_phone_number \
  ,   mask \
  ,   iso_country_code
    '''
    
    src_carrier = "random_test"
    src_ip      = "0.0.0.0"
    dest_vcb    = nil
    trunk_group_col_name = "IDK"
    trunk_group_provider_name = "testing Verizon"
    identifying_phone_number  = "333444"
    mask = "111111"
    iso_country_code  = "US"
    
    # It finds trunk group carrier in the db, 
    # insert one records if there is not anything
    result = find_trunk_group_carrier(src_carrier \
                                  ,   src_ip \
                                  ,   dest_vcb \
                                  ,   trunk_group_col_name \
                                  ,   trunk_group_provider_name \
                                  ,   identifying_phone_number \
                                  ,   mask \
                                  ,   iso_country_code)
                                  
    #record = for_test_find_trunk_group_carrier(src_carrier) # TODO the wrapper function is in callcache_parser_help.rb 
    record = nil #DimenTrunkGroupCarrier.find(:all)
    #assert(record.src_carrier==result.src_carrier) #TODO any other fields?
    #record.remove!
  end
  
  
  def find_trunk_group_carrier(src_carrier \
                                  ,   src_ip \
                                  ,   dest_vcb \
                                  ,   trunk_group_col_name \
                                  ,   trunk_group_provider_name \
                                  ,   identifying_phone_number \
                                  ,   mask \
                                  ,   iso_country_code)
                                  #dummy function
                                  return nil
  end
                              
                                  
end